
using Admin2024.Domain.Entity;

namespace Admin2024.Domain.Interface;

public interface IRepository<T> where T : BaseEntity
{

      IQueryable<T> Table {get;}
    // 根据id获取实体
    Task<T> GetByIdAsync(Guid id);
    
    // 获取实体列表
    Task<List<T>> GetListAsync();
    
    Task<T> CreateAsync(T entity);
    
    Task<T> UpdateAsync(Guid id, T entity);
    
    Task<T> UpdateAsync(T entity);
    Task<T?> DeleteAsync(T entity);
    Task<T?> DeleteAsync(Guid id);

    Task<T?> EnableAsync(Guid id);

    Task<T?> DisableAsync(Guid id);

    Task DeleteRangeAsync(IEnumerable<Guid> ids);
}
